/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ihc.terminalbanco.gui.panels;

import ihc.terminalbanco.gui.buttons.LabelButton;
import ihc.terminalbanco.gui.events.Events;
import ihc.terminalbanco.gui.events.KeyActionsMelhorIdade;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;

/**
 *
 * @author Rafael
 */
public class AvisoPainel extends JPanel implements RotulosInterface{

    Events events;
    KeyActionsMelhorIdade keyActions;
    public static Font fonte = ConstructMenusPanelsMelhorIdade.fonte;
    LabelButton sairButton, confirmarButton;

    public AvisoPainel(Events events, KeyActionsMelhorIdade keyActions, String avisoTitulo,
            String caminhoString, String avisoTexto) {
        this.setLayout(new BorderLayout());
        JPanel painelCentral = new JPanel();
        painelCentral.setLayout(new BoxLayout(painelCentral, BoxLayout.Y_AXIS));
        JLabel tituloLabel = new JLabel("<html><center>"+avisoTitulo+"</center><br><br></html>");
        tituloLabel.setFont(fonte);
        tituloLabel.setHorizontalAlignment(SwingConstants.CENTER);

        JTextPane ajudaPane = new JTextPane();
        ajudaPane.setText("\t"+caminhoString+"\n\n"+avisoTexto);
        ajudaPane.setEditable(false);
        ajudaPane.setOpaque(false);
        ajudaPane.setFont(fonte);

        painelCentral.add(tituloLabel);
        painelCentral.add(ajudaPane);

         JPanel painelSul = new JPanel();
        painelSul.setLayout(new GridLayout(1, 2,100,0));

        sairButton = new LabelButton(encerrarString,"images/encerrar.png");
        sairButton.setFont(fonte);
        sairButton.setVisible(true);
        sairButton.addActionListener(events);
        painelSul.add(sairButton);

        confirmarButton = new LabelButton(teclaDoisString+confirmarString,"images/continuar.png");
        confirmarButton.setFont(fonte);
        confirmarButton.setVisible(true);
        confirmarButton.addActionListener(events);
        painelSul.add(confirmarButton);

        painelSul.setPreferredSize(new Dimension(480, 100));
        this.add(painelCentral, BorderLayout.NORTH );
        this.add(painelSul, BorderLayout.SOUTH);
    }

    public void setSairButtonText(String texto){
        this.sairButton.setText(texto);
    }
    
}

